/// image : "https://volcano-cn02.tange365.com/5E3M2D5NDBMJ/2024/12/27/19/11-04.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKLTYjExZDlhYWMyZmE1NGFhOWE5NTliMjMwOTc2MWEzMjA%2F20241230%2Fcn-beijing%2Fs3%2Faws4_request&X-Amz-Date=20241230T033034Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=1ed6144ddb58b6c90f2a62db7c70ac75520e8e982d5833335aaf7234dc3e84ed"
/// thumbnail : "https://volcano-cn02.tange365.com/5E3M2D5NDBMJ/2024/12/27/19/11-04.jpg-168x120?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKLTYjExZDlhYWMyZmE1NGFhOWE5NTliMjMwOTc2MWEzMjA%2F20241230%2Fcn-beijing%2Fs3%2Faws4_request&X-Amz-Date=20241230T033034Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=b06a2051228978a8b3ac36ca7fa7e7058e59274ec4b38bc60831785dbf9037ee"
/// can_play : false
/// ossid : "51"
/// ossid_video : "51"
/// id : "5E3M2D5NDBMJ:motion:1735297864"
/// time : 1735297864
/// tag : {"msg":"发现移动","extra":{"data":"{}"},"icon":"https://icam-media-cloud-user-public.tange365.com/icon/15397@2x.png","name":"发现移动","tag":"motion"}

/// 消息列表 - 数据格式
class TangeEventKeyData {
  List<TangeEqEent>? keyList;
  int? total;

  TangeEventKeyData.fromJson(dynamic json) {
    keyList = [];
    total = json['total']; // 提取 total 值

    if (json['items'] is List) {
      for (var element in json['items']) {
        keyList?.add(TangeEqEent.fromJson(element));
      }
    }
  }

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['list'] = keyList?.map((e) => e.toJson()).toList();
    map['total'] = total;
    return map;
  }
}

class TangeEqEent {
  TangeEqEent({
      this.image, 
      this.thumbnail, 
      this.canPlay, 
      this.ossid, 
      this.ossidVideo, 
      this.id,
      this.deviceName,
      this.time, 
      this.tag,});

  TangeEqEent.fromJson(dynamic json) {
    image = json['image'];
    thumbnail = json['thumbnail'];
    canPlay = json['can_play'];
    deviceName = json['deviceName'];
    ossid = json['ossid'];
    ossidVideo = json['ossid_video'];
    id = json['id'];
    time = json['time'];
    tag = json['tag'] != null ? Tag.fromJson(json['tag']) : null;
  }
  String? image;
  String? thumbnail;
  bool? canPlay;
  String? ossid;
  String? ossidVideo;
  String? id;
  String? deviceName;
  num? time;
  Tag? tag;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['image'] = image;
    map['thumbnail'] = thumbnail;
    map['can_play'] = canPlay;
    map['ossid'] = ossid;
    map['ossid_video'] = ossidVideo;
    map['deviceName'] = deviceName;
    map['id'] = id;
    map['time'] = time;
    if (tag != null) {
      map['tag'] = tag?.toJson();
    }
    return map;
  }

}

/// msg : "发现移动"
/// extra : {"data":"{}"}
/// icon : "https://icam-media-cloud-user-public.tange365.com/icon/15397@2x.png"
/// name : "发现移动"
/// tag : "motion"

class Tag {
  Tag({
      this.msg, 
      this.extra, 
      this.icon, 
      this.name, 
      this.tag,});

  Tag.fromJson(dynamic json) {
    msg = json['msg'];
    extra = json['extra'] != null ? Extra.fromJson(json['extra']) : null;
    icon = json['icon'];
    name = json['name'];
    tag = json['tag'];
  }
  String? msg;
  Extra? extra;
  String? icon;
  String? name;
  String? tag;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['msg'] = msg;
    if (extra != null) {
      map['extra'] = extra?.toJson();
    }
    map['icon'] = icon;
    map['name'] = name;
    map['tag'] = tag;
    return map;
  }

}

/// data : "{}"

class Extra {
  Extra({
      this.data,});

  Extra.fromJson(dynamic json) {
    data = json['data'];
  }
  String? data;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['data'] = data;
    return map;
  }

}